const { rejects } = require('assert')
const db = require('./db')

let querySQL = (sql,arr)=>{
    //arr为占位符引入参数留的
    let p = new Promise((resolve,reject)=>{
        db.query(sql,arr,(error,result,fields)=>{
            if(error) reject(error)
            resolve(result)
        })
    })

    return p
}

module.exports = querySQL